import {createRouter,createWebHistory} from 'vue-router'
//导入组件
import LoginVue from '@/views/Login.vue'
import HomeVue from '@/views/Home.vue'

import MemberManagementVue from '@/views/admin/MemberManagement.vue'
import CoachManagementVue from '@/views/admin/CoachManagement.vue'
import EquipmentManagementVue from '@/views/admin/EquipmentManagement.vue'
import LessonManagementVue from '@/views/admin/LessonManagement.vue'
//定义路由关系
const routes = [
    {path: '/',redirect: '/login'},
    {path: '/login' ,component: LoginVue},
    {
        path: '/admin' ,
        component: HomeVue ,
        children:[
            {path:'/admin/member',component:MemberManagementVue},
            {path:'/admin/coach',component:CoachManagementVue},
            {path:'/admin/equipment',component:EquipmentManagementVue},
            {path:'/admin/lesson',component:LessonManagementVue}
        ]
    }
]
//创建路由器
const router = createRouter({
    history:createWebHistory(),
    routes:routes
})
//导出路由
export default router